﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Elentok.Common.UnitTests.Mocks
{
  class NotifierMock : INotifyPropertyChanged
  {
    #region INotifyPropertyChanged Members

    public event PropertyChangedEventHandler PropertyChanged;

    /// <summary>
    /// Raises the PropertyChanged event
    /// </summary>
    public void OnPropertyChanged(string propertyName)
    {
      PropertyChangedEventHandler handler = PropertyChanged;
      if (handler != null)
        handler(this, new PropertyChangedEventArgs(propertyName));
    }

    public Delegate[] GetInvocationList()
    {
      if (PropertyChanged == null)
        return null;

      return PropertyChanged.GetInvocationList();
    }
    #endregion

    private int _Number;

    /// <summary>
    /// Gets or sets the Number
    /// </summary>
    public int Number
    {
      get
      {
        return _Number;
      }
      set
      {
        if (_Number == value)
          return;

        _Number = value;
        OnPropertyChanged("Number");
      }
    }
  }
}
